Test-Series - programming logic

Test Number 7/15

Q: //assumne all header are included

int main()
{
int i=0;
int x=i++, y=++i;
printf("%d % d
", x,y);
return 0;
A. 0, 1
B. 1, 2
C. Undefined
D. 0, 2
Solution: The correct answer is:
0, 2
Q: What will be the output of the following code?

void main()
{
int x=5;
if (x<1);
printf("Hello");
}
A. Hello
B. Varies
C. Nothing
D. Run time error
Solution: The correct answer is:
Hello
Q: What is the output of this code?

//assume all header files are added

void main()
{
double k=0;
for (k=0.0;k<3.0;k++)
printf("hello");
}
A. Hello
B. Hello is printed thrice
C. Run time error
D. Hello is printed twice
Solution: The correct answer is:
Hello is printed thrice
Q: typedef declaration:
A. Does not create a new type
B. It merely adds a new name for some existing type
C. Both a & b
D. None of the mentioned
Solution: The correct answer is:
Both a & b
Q: Lori wants to find the smallest number out of 26 inputted numbers. How many minimum comparisons he has to make?
A. 26
B. 13
C. 25
D. 52
Solution: The correct answer is:
25
Q: What is the output of this code?

void main() {

 double k = 0;

 for (k = 0.0; k < 3.0; k++); 

 printf("%lf", k); 

 }
A. Run time error
B. 3.000000
C. 4.000000
D. 2.000000
Solution: The correct answer is:
3.000000
Q: Rohan writes the following program which inputs a number and prints "Triple digit" if the number is composed of three digits and "Not triple digit" if it is not.

if (number>99)
print "Triple digit"
else
print "Not triple digit"
end if

Rohan writes the following program which inputs a number and prints "Triple digit" if the number is composed of three digits and "Not triple digit" if it is not.
A. 100
B. 1000
C. 0
D. 99
Solution: The correct answer is:
1000
Q: Which keyword is used to come out of a loop only for that iteration?
A. continue
B. None of the mentioned
C. return
D. break
Solution: The correct answer is:
continue
Q: Term Data Structure refers to _________ and interrelationship between them.
A. None of these
B. Coding Standards
C. Organization of data element
D. Programming Language Statement
Solution: The correct answer is:
Organization of data element
Q: Can we declare the same variable inside the inner and outer block?
A. Duplicate Variable is not allowed in C Program
B. No , It will give compile error
C. Yes, It is possible
D. None of these
Solution: The correct answer is: Yes, It is possible

You Have Score    /10